import 'package:get/get.dart';
import 'package:library_base/base/empty_controller.dart';
import 'package:library_base/route/i_router.dart';
import 'package:module_common/page/buyer/choose_buyer_controller.dart';
import 'package:module_common/page/buyer/choose_buyer_page.dart';
import 'package:module_common/page/car/car_list_controller.dart';
import 'package:module_common/page/car/car_list_page.dart';
import 'package:module_common/page/driver/driver_list_controller.dart';
import 'package:module_common/page/driver/driver_list_page.dart';
import 'package:module_common/page/login/login_controller.dart';
import 'package:module_common/page/login/login_page.dart';
import 'package:module_common/page/main/main_controller.dart';
import 'package:library_base/route/middleware/login_middleware.dart';
import 'package:library_base/route/routers.dart';
import 'package:module_common/page/main/main_page.dart';
import 'package:module_common/page/multilingual/multilingual_controller.dart';
import 'package:module_common/page/multilingual/multilingual_page.dart';
import 'package:module_common/page/setting_weighing/setting_weighing_controller.dart';
import 'package:module_common/page/setting_weighing/setting_weighing_page.dart';
import 'package:module_common/page/splash/splash_page.dart';

class CommonRouter implements IRouter {
  @override
  List<GetPage> getPageBuilders() {
    return [
      GetPage(
        name: Routers.login,
        page: () => const LoginPage(),
        binding: BindingsBuilder(() {
          Get.lazyPut(() => LoginController());
        }),
      ),
      GetPage(
        name: Routers.main,
        page: () => const MainPage(),
        binding: BindingsBuilder(() {
          Get.lazyPut(() => MainController());
        }),
      ),
      GetPage(
          name: Routers.splash,
          page: () => const SplashPage(),
          binding: BindingsBuilder(() {
            Get.lazyPut(() => EmptyController());
          })),
      GetPage(
          name: Routers.carListPage,
          page: () => const CarListPage(),
          binding: BindingsBuilder(() {
            Get.lazyPut(() => CarListController());
          }),
          middlewares: [LoginMiddleware()]),
      GetPage(
          name: Routers.driverListPage,
          page: () => const DriverListPage(),
          binding: BindingsBuilder(() {
            Get.lazyPut(() => DriverListController());
          }),
          middlewares: [LoginMiddleware()]),
      GetPage(
          name: Routers.chooseSummaryBuyerPage,
          page: () => const ChooseBuyerPage(),
          binding: BindingsBuilder(() {
            Get.lazyPut(() => ChooseBuyerController());
          })),
      GetPage(
          name: Routers.MULTILINGUAL_PAGE,
          page: () => const MultilingualPage(),
          binding: BindingsBuilder(() {
            Get.lazyPut(() => MultilingualController());
          })),
      GetPage(
          name: Routers.settingWeighingPage,
          page: () => const SettingWeighingPage(),
          binding: BindingsBuilder(() {
            Get.lazyPut(() => SettingWeighingController());
          })),
    ];
  }
}
